<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<c:if test="${reportDataList != null }">
<div class="rpt05Container" >
<div><a href="${formData.excelURL }"><spring:message code="report.download"/></a></div>
<table width="90%"  class="rpt">
	<thead >
		<tr >
			<th >
				<spring:message code="report05.reportName"/>
			</th>
			<th colspan="${fn:length(reportDataList.timeName)+2 }" class="header">					
			</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<th><spring:message code="label.period"/></th>
			<c:forEach items="${reportDataList.timeName}" var="headerData" varStatus="status">
				<th>${headerData}</th>
			</c:forEach>
				<th><spring:message code="label.sum"/></th>
				<th><spring:message code="label.percentage"/></th>
			</tr>
			<c:forEach items="${reportDataList.itemName }" var="itemData" varStatus="status">
			<tr>
				<th width="16%">
					${itemData}
				</th>
				<c:forEach items="${reportDataList.itemValue[status.index] }" var="valueData" varStatus="valueDataStatus">
					<td  width="60px">${valueData }</td>
				</c:forEach>
				<td  width="60px">
					<c:if test="${not status.last}">
						<a href="${pageContext.request.contextPath}/report0502/doPreview.do?timeType=${formData.timeType}&defStartYear=${formData.defStartYear }&startYear=${formData.startYear }&endYear=${formData.endYear}&caseType=${reportDataList.itemNameValue[status.index]}">
							${reportDataList.itemTotalSum[status.index] }
						</a>
					</c:if>
					<c:if test="${status.last}">
						${reportDataList.itemTotalSum[status.index] }
					</c:if>
				</td>
				<td  width="60px">${reportDataList.itemTotalPercentage[status.index] }%</td>
			</tr>
			</c:forEach>
		</tbody>
</table>
<P  class="chartContainer">
<img src="${formData.imageURL }" >
</P>
<P  class="chartContainer">
<img src="${pieImgUrl}" >
</P>
</div>
</c:if>

<c:if test="${reportDataList == null &&  empty doLoad}">
	<div class="rpt05Container" >
		<h3>查無報表資料!!</h3>
	</div>
</c:if>